package com.bbdjt.weixin.service.impl;

import java.util.List;


import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.util.StringUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.bbdjt.weixin.model.LeaveWordQueryModel;
import com.bbdjt.weixin.base.service.impl.BaseServiceImpl;
import com.bbdjt.weixin.dao.LeaveWordDao;
import com.bbdjt.weixin.model.LeaveWord;
import com.bbdjt.weixin.service.LeaveWordService;

@Service("leaveWordService")
public class LeaveWordServiceImpl extends BaseServiceImpl<LeaveWord> implements LeaveWordService {
	
	@Override
    public List<LeaveWord> selectByLeaveWord(LeaveWord leaveWord, int page, int rows) {
        Example example = new Example(LeaveWord.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo(leaveWord);
        PageHelper.startPage(page, rows);
        return selectByExample(example);
    }
    
    @Override
    public List<LeaveWord> selectByLeaveWord(LeaveWord leaveWord) {
        Example example = new Example(LeaveWord.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo(leaveWord);
        return selectByExample(example);
    }

    @Override
    public PageInfo<LeaveWordQueryModel> selectByLeaveWordQueryModel(LeaveWordQueryModel leaveWord) {
    	return ((LeaveWordDao) getMapper()).selectByLeaveWordModel(leaveWord);
    }

	@Override
	public List<LeaveWord> selectByLeaveWord(LeaveWordQueryModel leaveWord) {
		  Example example = new Example(LeaveWord.class);
	        Example.Criteria criteria = example.createCriteria();
	        criteria.andEqualTo(leaveWord);
	        PageHelper.startPage(leaveWord.getPageNum(), leaveWord.getPageSize(),leaveWord.getOrderBy());
	        return selectByExample(example);
	}

	@Override
	public List<LeaveWord> selectAllleaveWord(LeaveWord leaveWord) {
		return ((LeaveWordDao) getMapper()).selectAllleaveWord(leaveWord);
	}

	
}